<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>webAssembly</title>
  </head>
  <body></body>
  <script>
    fetch("./index.wasm")
      .then((res) => res.arrayBuffer())
      .then((bytes) => WebAssembly.instantiate(bytes))
      .then((res) => {
        console.log(res);
        let num = res.instance.exports.add(35, 55);
        alert(num);
      });
  </script>
</html>
